package com.ziyia.a5_2_1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "Intent测试日志";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);





    }

    public void componentTest(View view) {
//        ComponentName componentName = new ComponentName("com.ziyia.a5_2_1", "com.ziyia.a5_2_1.MainActivity2");
//        ComponentName componentName = new ComponentName(this, "com.ziyia.a5_2_1.MainActivity2");
//        ComponentName componentName = new ComponentName(this, MainActivity2.class);


//        Intent intent = new Intent();

//        intent.setComponent(componentName);

//        intent.setClass(this, MainActivity2.class);
//        intent.setClassName("com.ziyia.a5_2_1", "com.ziyia.a5_2_1.MainActivity2");
//        intent.setClassName(this, "com.ziyia.a5_2_1.MainActivity2");


        Intent intent = new Intent(this, MainActivity2.class);

        startActivity(intent);
    }

    public void actionTest(View view) {

        Intent intent = new Intent();
        intent.setAction("helloworld");
        intent.addCategory("category_param");
        startActivity(intent);
    }
}